package com.thingsgrid.device.feign;

import com.thingsgrid.common.constant.CommonConstant;
import com.thingsgrid.device.entity.Device;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(
	value = CommonConstant.APPLICATION_DEVICE_NAME
)

public interface IDeviceClient {
	//接口前缀
	String API_PREFIX = "/api";
	/**
	 * 获取设备信息
	 */
	@GetMapping(API_PREFIX+"/detail2")
    R<Map<String, Object>> findDeviceById(@RequestParam String deviceId);
	/**
	 * 查询设备码是否存在
	 * 09.16
	 */
	@GetMapping(API_PREFIX+"/findDeviceByDeviceSn")
	Map<String,Object> findDeviceByDeviceSn(@RequestParam String deviceSn);

	/**
	 *说明：通过产品id获取设备列表
	 *@author lilongfei
	 *@since 2019/9/27 14:17
	 */
	@GetMapping(API_PREFIX+"/getDeviceListByProductId")
	R<List<Device>> getDeviceListByProductId(@RequestParam("productId")String productId);

}
